﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using gather.gt;
using System.Threading;
using ZF.BLL;

namespace gather
{
    class Class1
    {
        static void Main()
        {






























             a();


            HttpClient hc = new HttpClient();
            var s = hc.GetSrc("http://gz.ganji.com/jiaoyou4/10100613_95756.htm");
            var stream = hc.GetSteam("http://image.58.com/showphone.aspx?t=v55&v=1E77C9D45793D62BZ3FE604A1E26B2277", "utf-8", out s);
            byte[] buff = new byte[stream.Length];
            stream.Position = 0;
            stream.Read(buff, 0, buff.Length);
            System.IO.File.WriteAllBytes("ee.jpg", buff);
            
        }
        static void a()
        {

            var gts = new gtbase[] {new 二手市场(),
                 //new 二手市场1(),new 二手市场2(),new 物流货运(),new 交友征婚(),  new 车辆买卖(),new 搬家装修(), new 家居维修(), new 生活配送(), 
                //new 家电维修(), new 鲜花礼品(), new 家政家教(), new 保洁保养(), new 娱乐餐饮(),
            };

            foreach (var gt in gts)
            {
                gt.Domain = "http://gz.ganji.com/";
                gt.Init();
                //gt.Start();
                new Thread(gt.Start).Start();

                Thread.Sleep(1000);
            }
            while(gts.Any(p=>p.runing))
            {
                Thread.Sleep(1000);
            }
     
 
            //main.Main1(null);
            Console.Read();

        }

    }
}
